package zebbe.android.opengl;

import java.io.Serializable;

import zebbe.android.opengl.model.Cube;
import zebbe.android.opengl.support.SimulationListener;

/**
 * @author dzsebedi
 *
 */
public class Simulation implements Serializable{

	private static final long serialVersionUID = 7472019314249863294L;
	
	public transient SimulationListener listener;

	public Cube cube;
	
	public Simulation() {
		populate();
	}
	
	

	private void populate() {
		cube = new Cube(2,2,2);
		
		
	}



	public void update(float deltaTime) {
//		cube.rx += deltaTime*30;
//		cube.ry += deltaTime*20;
		cube.rx += cube.xVel * deltaTime;
		cube.ry += cube.yVel * deltaTime;
		
	}
	
	public void rotateCube(float dx, float dy) {
		cube.ry += dx;
		cube.rz += dy;
	}



	public void translateCube(float x, float y) {
		cube.x += x;
		cube.y += y;
	}

	public void setCubeVelocity(float x, float y) {
		cube.xVel = x;
		cube.yVel = y;
	}
}
